\documentclass[reprint,aps,pra,amsmath,amssymb,groupedaddress,floatfix,notitlepage]{revtex4-1}
\usepackage[dvips]{graphicx} 
\usepackage{listings}
\newcommand{\Sys}{\mathcal{S}}
\newcommand{\E}{\mathcal{E}}
\newcommand{\Li}{\mathcal{L}}
\newcommand{\ket}[1]{\vert #1 \rangle}
\newcommand{\bra}[1]{\langle #1 \vert}
\newcommand{\op}[2]{\vert#1\rangle\langle#2\vert}
\newcommand{\inner}[2]{\langle #1 \vert #2 \rangle}
\newcommand{\abs}[1]{\vert #1 \vert}
\newcommand{\re}[1]{\text{Re}\{#1\}}
\newcommand{\im}[1]{\text{Im}\{#1\}}
\newcommand{\tr}[2]{\text{tr}_#2\left\{#1\right\}}
\newcommand{\Hil}{\mathcal{H}}
\newcommand{\Heff}{H_{\text{eff}}}
\newcommand{\norm}[1]{\vert\vert #1\vert\vert}
\newcommand{\SP}{\text{SP}}
\newcommand{\TP}{\text{TP}}
\newcommand{\T}{T_{\leftarrow}}


\begin{document}
\title{NMQJ-package documentation}

\author{Kimmo Luoma}
\email{ktluom@utu.fi}
\affiliation{Turku Center for Quantum Physics, Department of Physics and 
Astronomy, University of Turku, FIN-20014, Turun Yliopisto, Finland}

%\homepage[]{Your web page}
%\thanks{}
%\altaffiliation{}

%\author{Jyrki Piilo}
%\email{jyrki.piilo@utu.fi}
%\noaffiliation

%Collaboration name if desired (requires use of superscriptaddress
%option in \documentclass). \noaffiliation is required (may also be
%used with the \author command).
%\collaboration can be followed by \email, \homepage, \thanks as well.
%\collaboration{}
%\email{}
%\noaffiliation

\date{\today}

\begin{abstract}
This is documentation for NMQJ code developed by author. 
Code is developed with C++ and python.
\end{abstract}

% insert suggested PACS numbers in braces on next line
\pacs{}
% insert suggested keywords - APS authors don't need to do this
%\keywords{}
\maketitle
\section{Input}\label{sec:input}
We use XML-format for input files. They are parsed with TinyXML++.
Input files consist of nodes.
\begin{itemize}
\item It begins with the following root node
  \lstinputlisting[language=XML,firstline=1,lastline=2]{../in_ladder.xml}
  \lstinputlisting[language=XML,firstline=49,lastline=49]{../in_ladder.xml}
  which must  contain all other input parameters as children nodes.
  \item Allowed children nodes are (others are ignored)
  \begin{itemize}
  \item \texttt{Simulation Params} element which contais the following 
    attributes
    that are selfexplanatory except \texttt{OutputStep}.
    \lstinputlisting[language=XML,firstline=3,lastline=7]{../in_ladder.xml} 
    \texttt{OutputStep} has default value $1$ which means that output is
    generated at ever time step. Value $n$ means that every $n$th time step
    program writes to output.
    \begin{itemize}
    \item Note that \texttt{SimulationParams} element does not contain any
      childrens, only attributes!
    \item Only optional attribute is \texttt{OutputStep}. If others 
      are also omitted, error is raised.
    \end{itemize}
  \item \texttt{System} element which contains the following 
    attributes and children nodes
    \lstinputlisting[language=XML,firstline=8,lastline=30]{../in_ladder.xml}
    \begin{itemize}
    \item \texttt{Basis} is the basis for the system Hilbert space given as a
      matrix where rows are basis vectors.
    \item\texttt{mixed} can have values 
      \texttt{yes}/\texttt{no}. Default value \texttt{no}.
    \item \texttt{InitialState} gives the weight of the initial state for
      each basis vectors. If \texttt{mixed}=\texttt{yes}, then must be
      given as a matrix.
    \end{itemize}
  \item \texttt{JumpOp} element which has the following attributes
    \lstinputlisting[language=XML,firstline=14,lastline=21]{../in_ladder.xml}  \end{itemize}
  \begin{itemize}
  \item Input file must contain \texttt{NumberOfChannels} \texttt{JumpOp} children elements.
  \item If wrong number \texttt{JumpOp} children elements exists or 
    any other attribute then \texttt{mixed} is missing, error is raised.
  \end{itemize}
  \item \texttt{Output} children node.
    \lstinputlisting[language=XML,firstline=31,lastline=48]{../in_ladder.xml}
\end{itemize}
Complete and valid input file looks like
\lstinputlisting[language=XML]{../in_ladder.xml}
\end{document}
